package com.lzy.cloud.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * Created with IntelliJ IDEA.
 * Description: lzy-cloud-service
 *
 * @author: ellengou
 * @date: 2018-05-22 星期二
 * @time: 15:07
 */
@Configuration
public class SpringMvcConfig {

    /**
     * 文件上传
     * @return
     */
    @Bean
    public CommonsMultipartResolver getCommonsMultipartResolver(){
        CommonsMultipartResolver commonsMultipartResolver=new CommonsMultipartResolver();
        commonsMultipartResolver.setMaxUploadSize(104857600);
        commonsMultipartResolver.setMaxInMemorySize(4096);
        return commonsMultipartResolver;
    }

}
